From b8d28064178074d7f4022900b948b70f408af397 Mon Sep 17 00:00:00 2001 From: David King Date: Tue, 13 Nov 2012 14:13:32 +0000 Subject: [PATCH] docs: Reorder compiler command line for new GCC Newer versions of GCC/binutils must have the source file come before the preprocessor and linker flags on the compiler command line, and this is also compatible with previous versions. https://bugzilla.gnome.org/show_bug.cgi?id=680241 --- docs/reference/gtk/compiling.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/gtk/compiling.sgml b/docs/reference/gtk/compiling.sgml index 012cb70eda..f61460c6d1 100644 --- a/docs/reference/gtk/compiling.sgml +++ b/docs/reference/gtk/compiling.sgml @@ -42,7 +42,7 @@ feature of the shell. If you enclose a command in backticks substituted into the command line before execution. So to compile a GTK+ Hello, World, you would type the following: -$ cc `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello +$ cc `pkg-config --cflags gtk+-3.0` hello.c -o hello `pkg-config --libs gtk+-3.0` @@ -67,7 +67,7 @@ this range will trigger compiler warnings. Here is how you would compile hello.c if you want to allow it to use symbols that were not deprecated in 3.2: -$ cc -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_2 `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello +$ cc `pkg-config --cflags gtk+-3.0` -DGDK_VERSION_MIN_REQIRED=GDK_VERSION_3_2 hello.c -o hello `pkg-config --libs gtk+-3.0` @@ -75,7 +75,7 @@ $ cc -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_2 `pkg-config --cflags --libs gtk+ And here is how you would compile hello.c if you don't want it to use any symbols that were introduced after 3.4: -$ cc -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4 `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello +$ cc `pkg-config --cflags gtk+-3.0` -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4 hello.c -o hello `pkg-config --libs gtk+-3.0` -- 2.30.2